package oa.web.controller;

import java.util.List;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import oa.biz.ActivityBiz;
import oa.entity.Activity;
import oa.entity.Employee;

@RestController
@RequestMapping("/api")
public class ActivityController {
	@Autowired
	private ActivityBiz actbiz;
	
	@RequestMapping("/activity")
	public List<Activity> getActivity(HttpSession session){
		Employee emp = (Employee) session.getAttribute("employee");
		int ActorId =emp.getId();
		return actbiz.getAll(ActorId);
	}
	@RequestMapping("/activity-calendar")
	public List<Activity> getActivityCalendar(HttpSession session){
		Employee emp = (Employee) session.getAttribute("employee");
		int ActorId =emp.getId();
		return actbiz.getList(ActorId);
	}
}